home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
076-100
/
disk_084
/
ed
/
system.c
< prev
next >
Wrap
Text File
|
1992-05-06
|
245b
|
19 lines
#define SHELL "/bin/sh"
system(c)
char *c; {
int pid, status;
switch (pid = fork()) {
case -1:
return -1;
case 0:
execl(SHELL, "sh", "-c", c, (char *) 0);
exit(-1);
default:
while (wait(&status) != pid)
;
}
return status;
}